//package com.eastfair.gateway.listener;
//
//import com.eastfair.mq.model.MySimpleMessage;
//import com.eastfair.mq.service.BusinessPointService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.spring.annotation.ConsumeMode;
//import org.apache.rocketmq.spring.annotation.MessageModel;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @Description: 单个业务类型发送
// */
//@Slf4j
//@Component
//@RocketMQMessageListener(topic = "${rocketmq.consumer.businessPointTopic}", consumerGroup = "${spring.application.name}-${spring.profiles.active}",
//        selectorExpression = "gateway_gateway_black",
//        messageModel = MessageModel.CLUSTERING, consumeMode = ConsumeMode.ORDERLY)
//public class BusinessPointListner implements RocketMQListener<MySimpleMessage>, RocketMQPushConsumerLifecycleListener {
//
//    @Autowired
//    private BusinessPointService businessPointService;
//
//    @Override
//    public void onMessage(MySimpleMessage message) {
//        businessPointService.execute(message);
//    }
//
//    @Override
//    public void prepareStart(DefaultMQPushConsumer consumer) {
//        // 设置最大重试次数
//        consumer.setMaxReconsumeTimes(4);
//    }
//}
